function plot_vectors(s_cfg, s_roi, u, v, type)

%Tests the scale
%u(80,80) = .1;
%v(80,80) = 0;
%draws the arrows
switch(type)
    case 'map'
        m_quiver(s_roi.c_x2d( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                s_roi.c_y2d( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                u( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                v( 1:s_cfg.stride:end, 1:s_cfg.stride:end), 0, 'k');
    otherwise
        quiver(s_roi.c_x2d( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                s_roi.c_y2d( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                u( 1:s_cfg.stride:end, 1:s_cfg.stride:end), ...
                v( 1:s_cfg.stride:end, 1:s_cfg.stride:end), 0, 'k');
end    
   
hold on
    
% Draws the arrows scale 
switch(type)
    case 'map'
        m_quiver(s_cfg.legpos(1), ...
                s_cfg.legpos(2), ...
                s_cfg.legpos(3), ...
                s_cfg.legpos(4), ...
                0,'k');
    otherwise
        quiver(s_cfg.legpos(1), ...
                s_cfg.legpos(2), ...
                s_cfg.legpos(3), ...
                s_cfg.legpos(4), ...
                0,'k');
end

%Draws the legend
htv5 = text( .015, .69, s_cfg.legkey);
set(htv5,'FontSize',8);
